<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
  /* 属性选择器，只要在你的元素里面包含title的这个属性，我就给你选中 */
  [title] {
    color: red;
  }
  [title=div] {
    background-color: blue;
  }
  </style>
</head>
<body>
  <div>我是div元素</div>
  <div title="div">我也是div元素</div>
  <p>我是p元素</p>
  <h2 title="h2">我是h2元素</h2>
</body>
</html>